﻿-- =========================================================================================================
-- Author:		MICHAEL RITACCO
-- Copyright:	2010 MEKHANO GROUP LLC
-- Version:		08/29/2010 1.0
-- =========================================================================================================
CREATE PROCEDURE [flcr].[api_device_config_dependent_dml_del]
	 (@DEVICE_CONFIG_DEPENDENT_UDT AS [flcr].[DEVICE_CONFIG_DEPENDENT_UDT] READONLY)

AS

BEGIN TRY
	BEGIN TRAN;
	
	DELETE	[flcr].[DEVICE_CONFIG_DEPENDENT]
	 WHERE	[DEVICE_CONFIG_DEPENDENT_ID] IN (SELECT [DEVICE_CONFIG_DEPENDENT_ID] FROM @DEVICE_CONFIG_DEPENDENT_UDT)

	DELETE	[flcrTM].[DEVICE_CONFIG_DEPENDENT]
	 WHERE	[DEVICE_CONFIG_DEPENDENT_ID] IN (SELECT [DEVICE_CONFIG_DEPENDENT_ID] FROM @DEVICE_CONFIG_DEPENDENT_UDT)

	COMMIT TRAN;

END TRY
BEGIN CATCH
	ROLLBACK TRANSACTION;
	EXEC [flcr].[utl_getDBError];
END CATCH
